package com.ph.controller;

import com.ph.pojo.Result;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ErrorController {

    @ExceptionHandler(Exception.class)
    public Result error(Exception e) {
        e.printStackTrace();
        return Result.failed(e.getMessage());
    }
    @ExceptionHandler(IncorrectCredentialsException.class)
    public Result error(IncorrectCredentialsException e) {
        e.printStackTrace();
        return Result.failed("密码错误");
    }
}
